package com.crr.service.impl;

import com.crr.bean.Customer;
import com.crr.common.bean.PageBean;
import com.crr.common.crud.BaseServiceImpl;
import com.crr.mapper.CustomerMapper;
import com.crr.service.CustomerService;
import com.crr.service.UserService;
import com.crr.utils.Assert;
import org.apache.ibatis.javassist.compiler.ast.Variable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class CustomerServiceImpl extends BaseServiceImpl<Customer, CustomerMapper> implements CustomerService {
   @Autowired
    UserService userService;
    @Override
    public int save(Customer entity) {
        entity.getUser().setType(4);
        int res = userService.save(entity.getUser());
        Assert.isNotSuccess(res,"客户保存失败");
        return super.save(entity);
    }
}
